#! /bin/bash
#hdp.sh start/stop
#1、判断参数是否传入
if [ $# -lt 1 ]
then
	echo "必须传入start/stop..."
	exit
fi
#2、根据参数启动/停止hadoop
case $1 in
"start")
	echo "==========启动hdfs=========="
	ssh hadoop102 "start-dfs.sh"
	echo "==========启动yarn=========="
	ssh hadoop103 "start-yarn.sh"
;;
"stop")
	echo "==========停止yarn=========="
	ssh hadoop103 "stop-yarn.sh"
	echo "==========停止hdfs=========="
	ssh hadoop102 "stop-dfs.sh"
;;
*)
	echo "参数输入错误..."
;;
esac